<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        
        <div>
                商品名:{{goods.name}}<br>
                价格:{{goods.price}}<br>
                数量:{{goods.num}}<br>
                标签:<span v-for="tag in goodstags">{{tag}}</span>
        </div>
        <script>
           new Vue({
               el:"div",
               data:{
                   goods: {name:"华为手机",price:2999,num:100,tags:"新品 上市"}
               },
               computed:{
                   goodstags:function(){
                       return this.goods.tags.split(/\s+/);
                   }
               }
           });
        </script>
    </body>
</html>
